#define CAMERA_h

#ifdef __cplusplus
extern "C" {
#endif

#include <stdio.h>
#include "buffer.h"


#define U2LSR (*(volatile unsigned char *)0xE007C014)
#define U2LSR_RDR_MASK 0x1
#define U2LSR_RDR 0x1
#define U2LSR_RDR_BIT 0
#define U2LSR_OE_MASK 0x2
#define U2LSR_OE 0x2
#define U2LSR_OE_BIT 1
#define U2LSR_PE_MASK 0x4
#define U2LSR_PE 0x4
#define U2LSR_PE_BIT 2
#define U2LSR_FE_MASK 0x8
#define U2LSR_FE 0x8
#define U2LSR_FE_BIT 3
#define U2LSR_BI_MASK 0x10
#define U2LSR_BI 0x10
#define U2LSR_BI_BIT 4
#define U2LSR_THRE_MASK 0x20
#define U2LSR_THRE 0x20
#define U2LSR_THRE_BIT 5
#define U2LSR_TEMT_MASK 0x40
#define U2LSR_TEMT 0x40
#define U2LSR_TEMT_BIT 6
#define U2LSR_RXFE_MASK 0x80
#define U2LSR_RXFE 0x80
#define U2LSR_RXFE_BIT 7 
#define PCONP_PCUART2_BIT 24
#define U2LCR_Divisor_Latch_Access_Bit_BIT 7 
#define U2ACR_Start_BIT 0
#define U2ACR_Mode_BIT 1 
#define VICIntSelect_UART2_BIT 29 

//Serial
__irq __nested __arm void UART2Handler(void);

void serial2_enable(int baud);

void CAM_Init(void);
void CAM_Shot(void);

#ifdef __cplusplus
}
#endif

//#endif